<%@page import="java.io.*"%>
<%@page import="java.net.*"%>
<%
URL url = new URL("http://localhost:8080/aws_test.jsp");
HttpURLConnection httpCon = (HttpURLConnection) url.openConnection();
httpCon.setDoOutput(true);
//request.setAttribute("id", "parameter");
//out.println(httpCon.getResponseCode());
//out.println(httpCon.getResponseMessage());
//String testaaa = (String)request.getAttribute("aaa");
//out.println(testaaa);

//httpCon.setRequestProperty("Accept", "application/json");
httpCon.setRequestMethod("POST");
OutputStreamWriter outt = new OutputStreamWriter(httpCon.getOutputStream());
  outt.write("parameter=heloo"); //json type
outt.close();

InputStream inStrm = httpCon.getInputStream();
int ch;
String rslt="";
while (((ch = inStrm.read()) != -1)){
	char temp = (char)ch;
	String str = Character.toString(temp);
	rslt = rslt+str;
}
rslt = rslt.trim();
out.println(rslt);
System.out.println(rslt);
inStrm.close();

	httpCon.disconnect();
//int responsecode = Integer.parseInt(input.readLine());

 
// to make sure all our query parameters are encoded properly we add them 
// using scribe rather than putting them in the URL
 // URL url2 = new URL("http://localhost:8080/EventCalendar_BE/index.jsp");
   // HttpURLConnection httpCon2 = (HttpURLConnection) url.openConnection();

    //InputStream inStrm = httpCon2.getInputStream();
    //System.out.println("\nContent at " + url);
%>